<script>
import { withStore } from '@/utils/withStore'
export default withStore({
  template: `
    <el-radio-group v-bind="$attrs" v-on="$listeners" v-loading="loading" style="width:100%;">
      <template v-if="error">
        <div style="display:flex;">
          <div style="font-size:13px;">数据加载失败, 请重试</div>
          <el-button type="text" @click="load">重试</el-button>
        </div>
      </template>
      <template v-else>
        <el-radio v-for="(item, index) in data" :key="index" :label="item.value">{{ item.label }}</el-radio>
      </template>
    </el-radio-group>
  `
})
</script>
